<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopProcessDetail extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_process_detail', function (Blueprint $table) {
            $table->id();

            $table->unsignedInteger('mainProcessId')->default(0)->comment('开店主流程ID');
            $table->unsignedTinyInteger('mainProcessType')->default(0)->comment('开店主流程类型');
            $table->string('mainProcessDesc', 48)->default('')->comment('开店主流程描述');
            $table->unsignedTinyInteger('processType')->default(0)->comment('流程类型');
            $table->string('processDesc', 48)->default('')->comment('流程描述');

            $table->unsignedTinyInteger('status')->default(1)->comment('状态 0-失败 1 - 成功');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->collation = 'utf8mb4_general_ci';
            $table->index(['mainProcessId'], 'idx_mainProcessId');
            $table->comment = '开店 - 流程日志';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_process_detail');
    }
}
